use std::sync::Arc;
use crate::{
    abstractions::{data::Data, task::TaskAbstraction}, error::ServerError, protocol::{datatypes::SYSTEM_DATA_TYPE, task::SymbolicTask, type_schema::TypeSchema},
};
use super::calibration_impl::*;
    
pub struct BuiltinCalibration {
    pub name: String,
    pub description: String,
    pub calib_oc2p: SymbolicTask,
    pub calib_les7p: SymbolicTask,
}

impl BuiltinCalibration {
    pub fn new() -> Self {
        Self {
            name: "BuiltinCalibration".into(),
            description: "用于计算从图像坐标到世界坐标的矩阵matrix".into(),
            calib_oc2p: SymbolicTask { name: "calib_oc2p".into(), input_type: TypeSchema::from_str("FilePath"), output_type: TypeSchema::from_str("Json") },
            calib_les7p: SymbolicTask { name: "calib_les7p".into(), input_type: TypeSchema::from_str("FilePath"), output_type: TypeSchema::from_str("Json") },
        }
    }

    pub fn calib_oc2p(&self) -> Arc<TaskAbstraction> {
        let input_type = self.calib_oc2p.input_type.clone();
        let output_type = self.calib_oc2p.output_type.clone();
        Arc::new(TaskAbstraction::Builtin("calib_oc2p".into(), input_type, output_type, Arc::new(calib_oc2p_func)))
    }

    pub fn calib_les7p(&self) -> Arc<TaskAbstraction> {
        let input_type = self.calib_les7p.input_type.clone();
        let output_type = self.calib_les7p.output_type.clone();
        Arc::new(TaskAbstraction::Builtin("calib_les7p".into(), input_type, output_type, Arc::new(calib_les7p_func)))
    }
    
    
}


